package io.lvdaxian.mybatis18.transaction.jdbc;


import io.lvdaxian.mybatis18.session.TransactionIsolationLevel;
import io.lvdaxian.mybatis18.transaction.Transaction;
import io.lvdaxian.mybatis18.transaction.TransactionFactory;

import javax.sql.DataSource;
import java.sql.Connection;

public class JdbcTransactionFactory implements TransactionFactory {
  @Override
  public Transaction newTransaction(Connection connection) {
    return new JdbcTransaction(connection);
  }
  
  @Override
  public Transaction newTransaction(DataSource dataSource, TransactionIsolationLevel level, boolean isAutoCommit) {
    return new JdbcTransaction(dataSource, level, isAutoCommit);
  }
}
